<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">
	<ui:define name="content">
		<h:head>
			<title>檔案刪除</title>
		</h:head>		
		<h:form>
			<p:growl id="growl" showDetail="true" sticky="true" />
			<p:panel id="fileDeleteController" header="檔案刪除">
				<p:fieldset legend="檔案刪除">
					<table>
						<tr>
							<td>
								<font color="red" size="1">*</font>
								<h:outputText value="類型：" />
							</td>
							<td>
								<p:selectOneRadio id="type" value="#{fileDeleteController.dto.type}"> 
									<f:selectItem itemLabel="公文" itemValue="Y"/>
									<f:selectItem itemLabel="非公文" itemValue="N" />
								</p:selectOneRadio>
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="密件：" />
							</td>
							<td>
								<p:selectOneRadio id="sercet" value="#{fileDeleteController.dto.sercet}"> 
									<f:selectItem itemLabel="是" itemValue="Y" />
									<f:selectItem itemLabel="否" itemValue="N" />
								</p:selectOneRadio>
							</td>
						</tr>
						<tr>
							<td>
								<font color="red" size="1">*</font>
								<h:outputText value="日期區間：" />
							</td>
							<td>
								<p:calendar id="startDate" showOn="button" value="#{fileDeleteController.dto.startDate}"/>~
								<p:calendar id="endDate" showOn="button" value="#{fileDeleteController.dto.endDate}"/>
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="分類號："/>
							</td>
							<td>
								<h:inputText value="#{fileDeleteController.dto.classNum}" />
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="公文文號："/>
							</td>
							<td>
								<h:inputText value="#{fileDeleteController.dto.disPatchNum}"/>
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="主旨："/>
							</td>
							<td>
								<h:inputTextarea value="#{fileDeleteController.dto.subject}"/>
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="機關："/>
							</td>
							<td>
								<h:inputText value="#{fileDeleteController.dto.government}"/>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<p:commandButton value="查詢" action="#{fileDeleteController.doQuery}" ajax="false" update="growl"/>
			   					<p:commandButton value="重設" ajax="false"/>
							</td>
						</tr>
					</table>
				</p:fieldset>			
				<p:fieldset legend="" id="resultList" rendered="#{fileDeleteController.dto.files != null}">
					<table width="100%">
					<p:dataTable var="file" value="#{fileDeleteController.dto.files}" rows="10"
						paginator="true"
						rowsPerPageTemplate="5,10,15">
						<p:column headerText="日期">
							<h:outputText value="#{file.uploadDate}" />
						</p:column>
						<p:column headerText="分類號">
							<h:outputText value="#{file.classNum}" />
						</p:column>
						<p:column headerText="公文文號">
							<h:outputText value="#{file.disPatchNum}" />
						</p:column>
						<p:column headerText="主旨">
							<h:outputText value="#{file.subject}" />
						</p:column>
						<p:column headerText="單位">
							<h:outputText value="#{file.officeId}" />
						</p:column>
						<p:column headerText="上傳者姓名">
							<h:outputText value="#{file.userName}" />
						</p:column>
						<p:column headerText="機關">
							<h:outputText value="#{file.government}" />
						</p:column>
						<p:column headerText="密件">
							<h:outputText value="#{file.secret}" />
						</p:column>
						<p:column headerText="">
							<h:outputText value="下載" />
						</p:column>
						<p:column headerText="">
							<h:outputText value="刪除" />
						</p:column>
					</p:dataTable>
				</table>
				</p:fieldset>			
			</p:panel>
		</h:form>
		
	</ui:define>

</ui:composition>
</html>